package com.dynamicprogram;

public class Solution2466 {
    public int countGoodStrings(int low, int high, int zero, int one) {
        int MOD = (int) 1e9 + 7;
        int[] dp = new int[high + 1];
        dp[0] = 1;
        for (int i = 1; i <= high; i++) {
            int a = i - zero >= 0 ? dp[i - zero] : 0;
            int b = i - one >= 0 ? dp[i - one] : 0;
            dp[i] = (a + b) % MOD;
        }
        int res = 0;
        for (int i = low; i <= high; i++) {
            res = (res + dp[i]) % MOD;
        }
        return res;
    }
}
